<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: DHFactor</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: DHFactor</td>
      <td class="subheader-left"><a href="matlab:open DHFactor">View code for DHFactor</a></td>
    </tr>
  </table>
<h1>DHFactor</h1><p><span class="helptopic">Simplify symbolic link transform expressions</span></p><p>
<strong>f</strong> = <span style="color:red">dhfactor</span>(<strong>s</strong>) is an object that encodes the kinematic model of a robot
provided by a string <strong>s</strong> that represents a chain of elementary transforms from
the robot's base to its tool tip.  The chain of elementary rotations and
translations is symbolically factored into a sequence of link transforms
described by DH parameters.

</p>
<p>
For example:

</p>
<pre style="width: 90%%;" class="examples">
s&nbsp;=&nbsp;'Rz(q1).Rx(q2).Ty(L1).Rx(q3).Tz(L2)';
</pre>
<p>
indicates a rotation of q1 about the z-axis, then rotation of q2 about the
x-axis, translation of L1 about the y-axis, rotation of q3 about the x-axis
and translation of L2 along the z-axis.

</p>
<h2>Methods</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> base</td> <td>the base transform as a Java string</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> tool</td> <td>the tool transform as a Java string</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> command</td> <td>a command string that will create a SerialLink() object
representing the specified kinematics</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> char</td> <td>convert to string representation</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> display</td> <td>display in human readable form</td></tr>
</table>
<h2>Example</h2>
<pre style="width: 90%%;" class="examples">
>>&nbsp;s&nbsp;=&nbsp;'Rz(q1).Rx(q2).Ty(L1).Rx(q3).Tz(L2)';
>>&nbsp;dh&nbsp;=&nbsp;DHFactor(s);
>>&nbsp;dh
DH(q1+90,&nbsp;0,&nbsp;0,&nbsp;+90).DH(q2,&nbsp;L1,&nbsp;0,&nbsp;0).DH(q3-90,&nbsp;L2,&nbsp;0,&nbsp;0).Rz(+90).Rx(-90).Rz(-90)
>>&nbsp;r&nbsp;=&nbsp;eval(&nbsp;dh.command('myrobot')&nbsp;);
</pre>
<h2>Notes</h2>
<ul>
  <li>Variables starting with q are assumed to be joint coordinates.</li>
  <li>Variables starting with L are length constants.</li>
  <li>Length constants must be defined in the workspace before executing the
last line above.</li>
  <li>Implemented in Java.</li>
  <li>Not all sequences can be converted to DH format, if conversion cannot be
achieved an error is generated.</li>
</ul>
<h2>Reference</h2>
<ul>
  <li>A simple and systematic approach to assigning Denavit-Hartenberg parameters,
P.Corke, IEEE Transaction on Robotics, vol. 23, pp. 590-594, June 2007.</li>
  <li>Robotics, Vision & Control, Sec 7.5.2, 7.7.1,
Peter Corke, Springer 2011.</li>
</ul>
<h2>See also</h2>
<p>
<a href="SerialLink.html">SerialLink</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2014 Peter Corke.</p>
</body></html>